import pymysql

def getSql():
	db = pymysql.connect(user = 'root',password='qinqingyyds',database='x18')
	cursor = db.cursor(cursor = pymysql.cursors.DictCursor)
	return cursor

# db = pymysql.connect(user = 'root',password='root',database='newProject')
# cursor = db.cursor(cursor = pymysql.cursors.DictCursor)
# sql = "select * from news"
# cursor.execute(sql)
# data = cursor.fetchall()